package cn.edu.cqupt.educationfoundation.votingsystem.controller;

import cn.edu.cqupt.educationfoundation.votingsystem.common.response.Response;
import cn.edu.cqupt.educationfoundation.votingsystem.common.response.ResponseEntity;
import cn.edu.cqupt.educationfoundation.votingsystem.common.response.ResponseStatu;
import cn.edu.cqupt.educationfoundation.votingsystem.model.dto.*;
import cn.edu.cqupt.educationfoundation.votingsystem.model.vo.*;
import cn.edu.cqupt.educationfoundation.votingsystem.service.BackManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author :DengSiYuan
 * @date :2019/10/25 21:47
 * @desc :
 */
@Api(tags = "后台管理模块")
@RestController
@RequestMapping("voteSystem")
public class BackManageController {

    @Resource
    private BackManageService backManageService;

    @ApiOperation("管理员登录")
    @PostMapping("adminLogin")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "adminName",value = "管理员名称",dataType = "string"),
            @ApiImplicitParam(name = "password",value = "密码",dataType = "string")
    })
    public ResponseEntity<AdminVo> adminLogin(String adminName,String password){
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }

    @ApiOperation("管理员注销")
    @PostMapping("adminLogOut")
    public ResponseEntity<AdminVo> adminLogOut(HttpServletRequest request){
        return new ResponseEntity<>(ResponseStatu.SUCCESS, Response.SUCCESSFUL,null);
    }


    @ApiOperation("创建活动")
    @PostMapping("activityCreate")
    public ResponseEntity<ActivityVo> createActivity(@RequestBody ActivityCreateDto activityCreateDto){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }


    @ApiOperation("更改活动")
    @PostMapping("activityUpdate")
    public ResponseEntity<ActivityVo> updateActivity(@RequestBody ActivityUpdateDto activityUpdateDto){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }


    @ApiOperation("删除活动")
    @DeleteMapping("activityDelete")
    public ResponseEntity<List<ActivityVo>> deleteActivity(@RequestBody List<Integer> activityIdList){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }

    @ApiOperation("添加活动海报")
    @PostMapping("activityImagesAdd")
    public ResponseEntity<ActivityImagesVo> addActivityImages(@RequestBody ActivityImagesCreateDto activityImagesCreateDto){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }

    @ApiOperation("删除活动海报")
    @DeleteMapping("activityImagesDelete")
    public ResponseEntity<List<ActivityImagesVo>> deleteActivityImages(@RequestBody List<Integer> activityImagesIdList){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }

    @ApiOperation("新建投票项")
    @PostMapping("voteCreate")
    public ResponseEntity<VoteOptionVo> createVote(@RequestBody VoteOptionCreateDto voteOptionCreateDto){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }


    @ApiOperation("修改投票项")
    @PostMapping("voteUpdate")
    public ResponseEntity<VoteOptionVo> updateVote(@RequestBody VoteOptionUpdateDto voteOptionUpdateDto){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }

    @ApiOperation("删除投票项")
    @DeleteMapping("voteDelete")
    public ResponseEntity<List<VoteOptionVo>> deleteVote(@RequestBody List<Integer> voteOptionIdList){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }

    @ApiOperation("投票数据分析")
    @GetMapping("voteAnalyze")
    public ResponseEntity<List<VoteAnalyzeVo>> voteAnalyze(Integer activityId ){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }

    @ApiOperation("添加投票项文件")
    @PostMapping("voteFileAdd")
    public ResponseEntity<VoteFileVo> addVoteFile(@RequestBody VoteFileDto voteFileDto){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }

    @ApiOperation("删除投票项文件")
    @DeleteMapping("voteFileDelete")
    public ResponseEntity<List<VoteFileVo>> deleteVoteFile(@RequestBody List<Integer> voteFileDeleteIdList){
        return new ResponseEntity<>(ResponseStatu.SUCCESS,Response.SUCCESSFUL,null);
    }
}
